package com.warm.pump.module.monitor.service.impl;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.module.monitor.bean.po.gen.MonitorDefineLn;
import com.warm.pump.module.monitor.dao.gen.MonitorDefineLnDao;
import com.warm.pump.module.monitor.service.IMonitorDefineLnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("MonitorDefineLnService")
public class MonitorDefineLnServiceImpl implements IMonitorDefineLnService {
	@Autowired
	private MonitorDefineLnDao monitorDefineLnDao;

	@Override
	public MonitorDefineLn queryObject(Long  id){
		return monitorDefineLnDao.selectByPrimaryKey( id);
	}

	public MonitorDefineLn queryObject(Map<String, Object> map){
		return monitorDefineLnDao.selectByMap( map);
	}
	
	@Override
	public List<MonitorDefineLn> queryList(Map<String, Object> map){
		return monitorDefineLnDao.getListByMap(map);
	}

    @Override
    public PageBean getPageBeanByMap(Map map,int pageNo,int pageSize) {
		return monitorDefineLnDao.getPageBeanByMap(map, pageNo, pageSize);
    }


	@Override
	public int queryTotal(Map<String, Object> map){
		return monitorDefineLnDao.countTotalByMap(map);
	}
	
	@Override
	public void save(MonitorDefineLn monitorDefineLn){
		monitorDefineLnDao.insertSelective(monitorDefineLn);
	}
	
	@Override
	public void update(MonitorDefineLn monitorDefineLn){
		monitorDefineLnDao.updateByPrimaryKeySelective(monitorDefineLn);
	}
	
	@Override
	public void delete(Long  id){
		monitorDefineLnDao.deleteByPrimaryKey(id);
	}

	@Override
	public void delete(Map<String, Object>  map){
	monitorDefineLnDao.deleteByMap(map);
	}
	
	@Override
	public void deleteBatch(Long[]  ids){
		Map<String, Object> map = new HashMap<>();
		map.put("id_in",ids);
		monitorDefineLnDao.deleteByMap(map);
	}
	
}
